﻿using System.Windows;
using System.Windows.Input;
using Microsoft.Extensions.DependencyInjection;
using RotovapPlatform.UI.ViewModels.Navigation;

namespace RotovapPlatform.UI.Views;

public partial class MainWindow : Window
{
	public MainWindow()
	{
		InitializeComponent();
		var navigationViewModel = App.ServiceProvider.GetRequiredService<NavigationViewModel>();
		DataContext = navigationViewModel;
	}

	private void ColorZone_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
	{
		if (e.ClickCount == 2)
		{
			MaximizeButton_Click(sender, e);
		}
		else
		{
			DragMove();
		}
	}

	private void MinimizeButton_Click(object sender, RoutedEventArgs e)
	{
		WindowState = WindowState.Minimized;
	}

	private void MaximizeButton_Click(object sender, RoutedEventArgs e)
	{
		WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
	}

	private void CloseButton_Click(object sender, RoutedEventArgs e)
	{
		Close();
	}
}